#ifndef VPROJECTATTRIBUTEDIALOG_H
#define VPROJECTATTRIBUTEDIALOG_H

#include <QDialog>
#include <QString>
#include <QStringList>
#include <QLineEdit>
#include <QJsonObject>

namespace Ui {
class VProjectAttributeDialog;
}

class VProjectAttributeDialog : public QDialog
{
    Q_OBJECT

public:
    explicit VProjectAttributeDialog(QWidget *parent, QString path);
    ~VProjectAttributeDialog();

    void full_path(QLineEdit *lineedit, int type, QString filter = "");
    void full_paths(QLineEdit *lineedit, int type, QString filter = "");

    bool _changed = false;

private slots:
    void on_update_configure();
    void on_btn_user_select_compile_run1_path_clicked();
    void on_btn_user_select_compile_run2_path_clicked();
    void on_btn_user_select_build_before_run1_path_clicked();
    void on_btn_user_select_build_before_run2_path_clicked();
    void on_btn_user_select_build_after_run1_path_clicked();
    void on_btn_user_select_build_after_run2_path_clicked();
    void on_btn_output_select_folder_clicked();
    void on_btn_ccpp_select_contain_path_clicked();
    void on_btn_linker_select_contain_lib_files_clicked();
    void on_btn_linker_select_contain_lib_paths_clicked();
    void on_btn_asm_select_contain_paths_clicked();
    void on_btn_apply_clicked();
    void on_btn_ok_clicked();
    void on_btn_cancel_clicked();

    void on_btn_list_select_output_folder_clicked();

    void on_combobox_brand_currentIndexChanged(const QString &arg1);

    void on_combobox_brand_currentIndexChanged(int index);

private:
    Ui::VProjectAttributeDialog *ui;

    enum TYPE{
        FOLDER,
        FILE
    };

    QStringList get_param_list(QString text, QChar sep);
    QJsonObject _project_json;
    QString _project_path;

    void init_connect();
    void load_setting(QJsonObject object);
    QJsonObject get_current_setting();
    void save_setting();
};
#endif // VPROJECTATTRIBUTEDIALOG_H
